﻿/*===================================================
* 类名称: ConsoleTitleHelper
* 类描述:
* 创建人: FONG
* 创建时间: 2017/12/26 22:04:34
* 修改人: 
* 修改时间:
* 版本： @version 1.0
=====================================================*/
using Model;
using System;
using System.Collections.Generic;
using System.Text;

namespace App
{
    public static class ConsoleTitleHelper
    {
        public static string GetTitle(Options options,StartConfig startConfig)
        {
            StringBuilder builder = new StringBuilder($"{options.AppType} - {options.AppId} | ");

            if (Game.Scene.HasComponent<NetOuterComponent>())
            {
                builder.Append($"OuterIP={startConfig.GetOuterIP()}");
            }

            if (Game.Scene.HasComponent<NetInnerComponent>())
            {
                builder.Append($", InnerIP={startConfig.GetInnerIP()}");
            }

            if (Game.Scene.HasComponent<WebServiceComponent>())
            {
                builder.Append($", ServerIP={startConfig.GetServerIP()}");
            }
            return builder.ToString();
        }
    }
}
